-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding versioning check for TypeSpec init template #2121
Conversation
Changes in this PR will be published to the following url to try(check status of TypeSpec Pull Request Try It pipeline for publish status): Website: https://cadlwebsite.z1.web.core.windows.net/prs/2121/ |
packages/compiler/src/init/init.ts
Outdated
@@ -286,7 +287,10 @@ async function validateTemplate(template: any, templatesUrl: TemplatesUrl): Prom | |||
const validationTarget = templatesUrl.file as SourceFile; | |||
let validationResult: ValidationResult; | |||
// 1. If current version > minimumCompilerVersion, proceed with strict validation | |||
if (template.minimumCompilerVersion && currentCompilerVersion > template.minimumCompilerVersion) { | |||
if ( | |||
template.minimumCompilerVersion && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we using semver
pacakge do we maybe just want to leave that as a semver range(>=0.45.0
) and rename to compilerVersion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the rename. Not sure about "leave that" means. compilerVersion
default value as ">=0.46.0" ?
function logDiagnostics(diagnostics: readonly Diagnostic[]): void { | ||
diagnostics.forEach((diagnostic) => { | ||
// eslint-disable-next-line no-console | ||
console.log(diagnostic.message); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we consider the rest of the diagnostic, code/severity not useful here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion
Also: